package iterator.collegeDisplay.aggregate.college;

import iterator.collegeDisplay.aggregate.college.base.College;
import iterator.collegeDisplay.iterator.InfoCollegeIterator;
import iterator.collegeDisplay.leaf.Department;

import java.util.ArrayList;
import java.util.Iterator;

public class InfoCollege implements College {

    private ArrayList<Department> departments;

    public InfoCollege() {
        departments = new ArrayList<Department>();
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departments);
    }

    @Override
    public String getName() {
        return "INFO";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departments.add(new Department(name, desc));
    }
}
